<%-- 
    Document   : login
    Created on : 2011-06-18, 23:56:56
    Author     : Mirek
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>Logowanie</title>
            <link rel="stylesheet" type="text/css" href="media/css/common.css" />
            <link rel="stylesheet" type="text/css" href="../media/css/common.css" />
            <link rel="stylesheet" type="text/css" href="media/css/form.css" />
            <link rel="stylesheet" type="text/css" href="../media/css/form.css" />
        </head>

        <h:form>
            <h:commandLink action="index" value="Powrót do strony głównej" />
        </h:form>

        <div id="main-wrapper">
            <h1>Logowanie</h1>
            <p>Wprowadź login i hasło podane podczas rejestracji aby zalogować się na swoje konto.</p>

            <h:form id="login">
                <h:outputText value="#{loginHelper.errorMessage}" escape="false" styleClass="form-error"/>
                
                <div>
                    <label for="login">Login: </label>
                    <h:inputText id="login" value="#{loginHelper.login}" required="true" >
                        <f:validateLength maximum="20" minimum="3" />
                    </h:inputText><h:message for="login" styleClass="form-error"/>
                </div>

                <div>
                    <label for="password">Hasło: </label>
                    <h:inputSecret id="password" value="#{loginHelper.password}" redisplay="false" required="true">
                        <f:validateLength maximum="25" minimum="3" />
                    </h:inputSecret><h:message for="password" styleClass="form-error"/>
                </div>
                
                <h:commandButton action="#{loginHelper.authenticate}" value="Zaloguj się" styleClass="submit"/>
            </h:form>
        </div>
    </html>
</f:view>
